package com.cwz.taculture.controller.mall;

import com.alibaba.fastjson.JSON;
import com.cwz.taculture.pojo.CommodityPojo;
import com.cwz.taculture.service.mall.MallService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
public class MallController {

    @Autowired
    private MallService mall_service;

    @RequestMapping("findCommodityByMall")
    public String findCommodityByMall (CommodityPojo commodityPojo){
        PageInfo list = mall_service.findCommodityByMall(commodityPojo);
        System.out.println(commodityPojo.getCommodityMeasure());
        String json = JSON.toJSONString(list);
        return json;
    }


}
